package server.command.ecs;

import app_kvServer.KVServer;
import server.command.client.ClientInputHandler;
import server.command.client.ICommand;
import utils.IKeyValueStorage;
import utils.SynchronizedAccessStorageUtil;
import common.messages.KVMessage.StatusType;

public class CommandUnlockWrite implements ICommand {
	private SynchronizedAccessStorageUtil storageUtil;
	
	public CommandUnlockWrite(SynchronizedAccessStorageUtil storageUtil) {
		this.storageUtil = storageUtil;
	}
	
	@Override
	public String execute() {
		storageUtil.unlockWrite();
		return ClientInputHandler.composeClientResponse(StatusType.SERVER_WRITE_UNLOCK, " ", ""); 
	}
}
